import requests
from lxml import etree
import sqlite3

respond = requests.get("https://www.xiaoshuopu.com/xiaoshuo/66/66191/")
content = respond.text
tree = etree.HTML(content)
data = tree.cssselect(".L a")
datas = [da.text for da in data]
datas2 = []
for i in range(len(datas)):
    datas2.append("1")
datas_list = list(zip(datas, datas2))
print(datas_list)

con = sqlite3.connect("../mysite/db.sqlite3")
cur = con.cursor()
cur.executemany("insert into main_recommendindexchapter (chapter,name_id) values (?,?)", datas_list)
con.commit()
cur.close()
con.close()


